package com.secsys.action.finance;

import java.util.List;

import org.apache.log4j.Logger;

import com.secsys.action.BaseAction;
import com.secsys.dto.AssistDto;
import com.secsys.dto.StoCapitalizationDTO;
import com.secsys.dto.StoFinanceassetdebtDTO;
import com.secsys.dto.StoFinancecashDTO;
import com.secsys.dto.StoFinanceperstockDTO;
import com.secsys.dto.StoFinanceprofitDTO;
import com.secsys.dto.StoPriceearningDTO;
import com.secsys.dto.StoRationedsharesDTO;
import com.secsys.dto.StoStockDTO;
import com.secsys.dto.StoStockdailyDTO;
import com.secsys.service.StoCapitalizationService;
import com.secsys.service.StoFinanceAssetDebtService;
import com.secsys.service.StoFinanceCashService;
import com.secsys.service.StoFinancePerStockService;
import com.secsys.service.StoFinanceProfitService;
import com.secsys.service.StoPriceearningService;
import com.secsys.service.StoRationedSharesService;
import com.secsys.service.StoStockService;
import com.secsys.service.StoStockdailyService;
import com.secsys.util.DateFormatUtils;

public class FinanceAssetDebtAction extends BaseAction<StoFinanceassetdebtDTO> {
	private static final long serialVersionUID = 4748825864974803025L;
	private Logger logger=Logger.getLogger(FinanceAssetDebtAction.class);

	/**
	 * 规定分页大小为10
	 */
	private final int limit=10; 
	
	private AssistDto assistDto;
	
	private StoFinanceassetdebtDTO stoFinanceassetdebtDTO;
	private StoFinanceprofitDTO stoFinanceprofitDTO;
	private StoPriceearningDTO stoPriceearningDTO;
	private StoStockdailyDTO stockdailyDTO;
	private StoRationedsharesDTO stoRationedsharesDTO;
	private StoFinanceperstockDTO stoFinanceperstockDTO;
	private StoFinancecashDTO stoFinancecashDTO;
	private StoCapitalizationDTO stoCapitalizationDTO;
	private StoStockDTO stockDTO;
	
	private StoFinanceAssetDebtService stoFinanceAssetDebtService;
	private StoFinanceProfitService stoFinanceProfitService;
	private StoPriceearningService stoPriceearningService;
	private StoStockdailyService stoStockdailyService;
	private StoRationedSharesService stoRationedSharesService;
	private StoFinancePerStockService stoFinancePerStockService;
	private StoFinanceCashService stoFinanceCashService;
	private StoCapitalizationService stoCapitalizationService;
	private StoStockService stoStockService;
	
	
	@Override
	public StoFinanceassetdebtDTO getModel() {
		if (null ==stoFinanceassetdebtDTO ) {
			stoFinanceassetdebtDTO=new StoFinanceassetdebtDTO();
		}
		return stoFinanceassetdebtDTO;
	}
 
	
	
	public String queryFinanceassetdebtByStockCode(String stockCode){
		StoFinanceassetdebtDTO stoFinanceassetdebtDTO=stoFinanceAssetDebtService.queryFinanceassetdebtByStockCode("600000");
		if (stoFinanceassetdebtDTO==null) {
			logger.info("queryFinanceassetdebtByStockCode null,stockCode="+stockCode);
			System.out.println("queryFinanceassetdebtByStockCode null,stockCode="+stockCode); 
		}
		return "search";
	}
	
	public String getFinanceassetdebt() throws Exception{
//		List<StoFinanceassetdebtDTO> financeassetdebtList=new ArrayList<StoFinanceassetdebtDTO>();
//		financeassetdebtList.add(stoFinanceAssetDebtService.queryFinanceassetdebtByStockCode(600000));
		try {
			
			List<StoFinanceassetdebtDTO> financeassetdebtList= stoFinanceAssetDebtService.queryFinanceassetdebtByDateRange(
					DateFormatUtils.convertStringToDate("2008-1-3"),DateFormatUtils.convertStringToDate("2010-1-3"),0,100);
//			List<StoFinanceassetdebtDTO> financeassetdebtList= stoFinanceAssetDebtService.queryFinanceassetdebtByAccountReceivableOtherRange(
//					48966.61,969569.49,0,100
//					);
			if (null ==financeassetdebtList ) {
				System.out.println("==null====213123==");
			} else {
				System.out.println("size:"+financeassetdebtList.size());
			}
			session.put("financeassetdebtList", financeassetdebtList);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "search";
	}
	
	
	
	

	public StoPriceearningDTO getStoPriceearningDTO() {
		return stoPriceearningDTO;
	}

	public void setStoPriceearningDTO(StoPriceearningDTO stoPriceearningDTO) {
		this.stoPriceearningDTO = stoPriceearningDTO;
	}

	public StoPriceearningService getStoPriceearningService() {
		return stoPriceearningService;
	}

	public void setStoPriceearningService(
			StoPriceearningService stoPriceearningService) {
		this.stoPriceearningService = stoPriceearningService;
	}

	public StoFinanceprofitDTO getStoFinanceprofitDTO() {
		return stoFinanceprofitDTO;
	}

	public void setStoFinanceprofitDTO(StoFinanceprofitDTO stoFinanceprofitDTO) {
		this.stoFinanceprofitDTO = stoFinanceprofitDTO;
	}

	public StoFinanceProfitService getStoFinanceProfitService() {
		return stoFinanceProfitService;
	}

	public void setStoFinanceProfitService(
			StoFinanceProfitService stoFinanceProfitService) {
		this.stoFinanceProfitService = stoFinanceProfitService;
	}

	public StoFinanceassetdebtDTO getStoFinanceassetdebtDTO() {
		return stoFinanceassetdebtDTO;
	}

	public void setStoFinanceassetdebtDTO(
			StoFinanceassetdebtDTO stoFinanceassetdebtDTO) {
		this.stoFinanceassetdebtDTO = stoFinanceassetdebtDTO;
	}

	public StoFinanceAssetDebtService getStoFinanceAssetDebtService() {
		return stoFinanceAssetDebtService;
	}

	public void setStoFinanceAssetDebtService(
			StoFinanceAssetDebtService stoFinanceAssetDebtService) {
		this.stoFinanceAssetDebtService = stoFinanceAssetDebtService;
	}

	public StoStockdailyDTO getStockdailyDTO() {
		return stockdailyDTO;
	}

	public void setStockdailyDTO(StoStockdailyDTO stockdailyDTO) {
		this.stockdailyDTO = stockdailyDTO;
	}

	public StoRationedsharesDTO getStoRationedsharesDTO() {
		return stoRationedsharesDTO;
	}

	public void setStoRationedsharesDTO(StoRationedsharesDTO stoRationedsharesDTO) {
		this.stoRationedsharesDTO = stoRationedsharesDTO;
	}

	public StoFinanceperstockDTO getStoFinanceperstockDTO() {
		return stoFinanceperstockDTO;
	}

	public void setStoFinanceperstockDTO(StoFinanceperstockDTO stoFinanceperstockDTO) {
		this.stoFinanceperstockDTO = stoFinanceperstockDTO;
	}

	public StoFinancecashDTO getStoFinancecashDTO() {
		return stoFinancecashDTO;
	}

	public void setStoFinancecashDTO(StoFinancecashDTO stoFinancecashDTO) {
		this.stoFinancecashDTO = stoFinancecashDTO;
	}

	public StoCapitalizationDTO getStoCapitalizationDTO() {
		return stoCapitalizationDTO;
	}

	public void setStoCapitalizationDTO(StoCapitalizationDTO stoCapitalizationDTO) {
		this.stoCapitalizationDTO = stoCapitalizationDTO;
	}

	public StoStockDTO getStockDTO() {
		return stockDTO;
	}

	public void setStockDTO(StoStockDTO stockDTO) {
		this.stockDTO = stockDTO;
	}

	public StoStockdailyService getStoStockdailyService() {
		return stoStockdailyService;
	}

	public void setStoStockdailyService(StoStockdailyService stoStockdailyService) {
		this.stoStockdailyService = stoStockdailyService;
	}

	public StoRationedSharesService getStoRationedSharesService() {
		return stoRationedSharesService;
	}

	public void setStoRationedSharesService(
			StoRationedSharesService stoRationedSharesService) {
		this.stoRationedSharesService = stoRationedSharesService;
	}

	public StoFinancePerStockService getStoFinancePerStockService() {
		return stoFinancePerStockService;
	}

	public void setStoFinancePerStockService(
			StoFinancePerStockService stoFinancePerStockService) {
		this.stoFinancePerStockService = stoFinancePerStockService;
	}

	public StoFinanceCashService getStoFinanceCashService() {
		return stoFinanceCashService;
	}

	public void setStoFinanceCashService(StoFinanceCashService stoFinanceCashService) {
		this.stoFinanceCashService = stoFinanceCashService;
	}

	public StoCapitalizationService getStoCapitalizationService() {
		return stoCapitalizationService;
	}

	public void setStoCapitalizationService(
			StoCapitalizationService stoCapitalizationService) {
		this.stoCapitalizationService = stoCapitalizationService;
	}

	public StoStockService getStoStockService() {
		return stoStockService;
	}

	public void setStoStockService(StoStockService stoStockService) {
		this.stoStockService = stoStockService;
	}

	public AssistDto getAssistDto() {
		return assistDto;
	}

	public void setAssistDto(AssistDto assistDto) {
		this.assistDto = assistDto;
	}

}
